<template>
	<view class="content">
		<view class="con-top">我的计划</view>
		<view v-if="formList.length>0">
			<picker-view indicator-class="selectLabel" :value="[1]" @change="change" class="picker-view" 
				mask-style="background:none;">
				<picker-view-column>
					<view class="item" v-for="(item,index) in formList" :key="index" @click="goDetail()">{{item.time}}
						{{item.title}}
					</view>
				</picker-view-column>
			</picker-view>
			<view>
				<uni-icons @click="forward" type="left" color="#fff"
					style="position: absolute;left: 10px;z-index: 29;top:44%;"></uni-icons>
				<uni-icons type="right" color="#fff" @click="next"
					style="position: absolute;right: 10px;z-index: 29;top: 44%;"></uni-icons>
			</view>
		</view>
		<view v-else>
			<view class="con-btm">当前无任务</view>
			
		</view>
		<view class="con-btn" @click="addPlan">去创建</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				formList: []
			};
		},
		onShow() {
			// uni.clearStorage() // 清除缓存 
			this.formList = uni.getStorageSync('jihua') || []
		},
		methods: {
			addPlan() {
				uni.navigateTo({
					url: "/pages/plan/add"
				});
			},
			goDetail() {
				uni.navigateTo({
					url: '/pages/plan/detail'
				});
			},
			forward() {

			},
			next() {
	
			},
			change(){
				
			}
		}
	}
</script>
<style>
	::v-deep .item{
		    max-width: 153px;
		    text-overflow: ellipsis;
		    white-space: nowrap;
		    text-align: center;
		    margin: auto
	}
</style>
<style lang="scss" scoped>
	.content {
		padding: 70rpx 20rpx 0;

		.con-top {
			text-align: center;

		}

		.con-btm {
			position: absolute;
			left: 50%;
			top: 50%;
			transform: translate(-50%, -50%);
			color: #93999c;
		}

		.con-btn {
			position: absolute;
			bottom: 10rpx;
			left: 50%;
			transform: translate(-50%, -50%);
			width: 90px;
			border: 1rpx solid #fff;
			text-align: center;
			padding: 10rpx 0;
			border-radius: 20rpx;
		}
		.picker-view {
			width: 90%;
			height: 195px;
			margin: 0 auto;
		
		}
		
		.picker-view .item {
			display: flex;
			
			align-items: center;
		
		}
	}
</style>